﻿<UserControl x:Class="StudentModule.Views.BasicSearchSinhVienView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:prism="http://www.codeplex.com/prism"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:inf_int="clr-namespace:Infrastructure.InteractionRequests;assembly=Infrastructure"
             xmlns:helper="clr-namespace:Infrastructure.Helpers;assembly=Infrastructure"
             xmlns:local="clr-namespace:StudentModule.Views"
             mc:Ignorable="d" 
             d:DesignHeight="720" d:DesignWidth="900" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/Infrastructure;component/Themes/CommonTemplates.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <helper:SuccessConverter x:Key="SuccessConverter" />
        </ResourceDictionary>
    </UserControl.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <StackPanel>
            <TextBlock Margin="40,10,0,0" Text="Tìm kiếm sinh viên" Grid.ColumnSpan="2"
                       FontWeight="Bold" Foreground="#FF7A7A7A" HorizontalAlignment="Left"  FontFamily="Segoe UI" FontSize="16" />
            <Rectangle Fill="#FFD6D6D6" Height="1" Margin="0,10 0,15" />
        </StackPanel>

        <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Row="1" HorizontalAlignment="Center"
					Margin="10">
            <telerik:RadWatermarkTextBox Height="23" Name="radWatermarkTextBox1" Width="350" Margin="0,0,15,0"
                                             ToolTip="Nhập từ khóa" WatermarkContent="Nhập từ khóa" 
                                             Text="{Binding Query, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
            <telerik:RadButton Width="38" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
                    Command="{Binding SearchCommand}"
                                   IsDefault="True">
                <telerik:RadButton.Content>
                    <Image Source="/Infrastructure;component/Images/MiniIcon/find.png" Height="14" Width="14"/>
                </telerik:RadButton.Content>
            </telerik:RadButton>
        </StackPanel>

        <StackPanel Grid.Row="2" Margin="5">
            <telerik:RadGridView Name="radGridView1" 
                             AutoGenerateColumns="False" ShowColumnHeaders="True" ShowGroupPanel="False"
                             ItemsSource="{Binding List, Mode=TwoWay}"
                             SelectedItem="{Binding CurrentItem, Mode=TwoWay}" CanUserDeleteRows="False" IsReadOnly="True">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="MouseDoubleClick" >
                        <i:InvokeCommandAction Command="{Binding EditCommand}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn Header="MSSV" DataMemberBinding="{Binding MaSinhVien}" />
                    <telerik:GridViewDataColumn Header="Họ sinh viên" DataMemberBinding="{Binding HoSinhVien}" />
                    <telerik:GridViewDataColumn Header="Tên sinh viên" DataMemberBinding="{Binding TenSinhVien}" />
                    <telerik:GridViewDataColumn Header="Khoa" DataMemberBinding="{Binding DonViTen}" />
                    <telerik:GridViewDataColumn Header="Lớp" DataMemberBinding="{Binding LopTen}" />
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>
        </StackPanel>
    </Grid>
</UserControl>